package com.example.demo.phone.controller;

import com.ah.ues.sdk.lcs.LcsClient;
import com.ah.ues.sdk.lcs.LcsServiceInfo;
import com.ah.ues.sdk.lcs.RpcContext;
import com.ah.ues.sdk.lcs.RpcMethod;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import redis.clients.jedis.JedisPool;

@Api(description = "通用接口")
@RestController
@RequestMapping("/test")
public class SendMessage {

    @GetMapping("/sendMessage")
    @ApiOperation(value = "列表")
    public Object list() {


        return "success";
    }

/*
    public void test() {
        LcsClient lcsClient = new LcsClient();
        lcsClient.setEnableConsumer(true);
        lcsClient.setEnableRedisConsumer(false);
        lcsClient.setRedisQueueNums(4);
        JedisPool jedisPool = new JedisPool("127.0.0.1", 6379);
        lcsClient.setJedisPool(jedisPool);
        lcsClient.addLcsAddress(new LcsServiceInfo("http", "","10.100.14.58", 8189, null));
        lcsClient.addRpcMethodForBean(new RpcTestService());
    }


    public class RpcTestService {
        @RpcMethod
        public void sayHello(RpcContext context) {
            System.out.println("接收请求:" + new String(context.getData()));
            context.response(true, null, "world".getBytes());
        }

    }*/
}
